home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / semaphores.h < prev    next >
C/C++ Source or Header  |  1996-09-12  |  1KB  |  40 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: semaphores.h,v 1.2 1996/08/01 17:41:27 digulla Exp $
  4.     $Log: semaphores.h,v $
  5.     Revision 1.2  1996/08/01 17:41:27  digulla
  6.     Added standard header for all files
  7.  
  8.     Desc:
  9.     Lang:
  10. */
  11. #ifndef SEMAPHORES_H
  12. #define SEMAPHORES_H
  13.  
  14. #include <exec/tasks.h>
  15. #include <exec/nodes.h>
  16.  
  17. /* Signal flag to awake tasks waiting on a semaphore */
  18. #define SEMAPHORESIGF (0x8000)
  19.  
  20. /*
  21.     Node for a task waiting synchronously:
  22.     Maybe this shouldn't have a struct Node as first element - but I want
  23.     it to be compatible to Procure()'s struct SemaphoreMessage.
  24.     This means that ln_Name contains the lock type (SM_EXCLUSIVE or
  25.     SM_SHARED). And since ln_Type is NT_MESSAGE for semaphore messages
  26.     waiting on the semaphore list it isn't free either. The only field
  27.     left in the node is ln_Pri which contains the node type (see below).
  28. */
  29. struct SemaphoreNode
  30. {
  31.     struct Node node;
  32.     struct Task *task;
  33. };
  34.  
  35. /* Node types in the semaphore's waiting queue */
  36. #define SN_TYPE_OBTAIN    0
  37. #define SN_TYPE_PROCURE 1
  38.  
  39. #endif
  40.